//
//  RemoteTableViewCell.m
//  CleanerAir_Project
//
//  Created by 付亚杰 on 16/7/26.
//  Copyright © 2016年 Beijing Colin El Internet. All rights reserved.
//

#import "RemoteTableViewCell.h"
#import "EquipmentModel.h"

@interface RemoteTableViewCell()

@property (weak, nonatomic) IBOutlet UIImageView *equipmentImage;
@property (weak, nonatomic) IBOutlet UILabel *equipmentName;

@property (weak, nonatomic) IBOutlet UILabel *equipmentState;

@end

@implementation RemoteTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setModel:(EquipmentModel *)model{
    if (model != nil) {
       _model = model;
        
        self.equipmentName.text = model.name;
        
        self.equipmentState.text = model.state.integerValue == 0 ? @"联机":@"未联机";
        
        self.equipmentImage.image = [self.equipmentState.text isEqualToString:@"联机"] ? [UIImage imageNamed:@"Remote_yellow.png"] : [UIImage imageNamed:@"Remote_white.png"] ;
    }
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
